home *** CD-ROM | disk | FTP | other *** search
/ The Atari Compendium / The Atari Compendium (Toad Computers) (1994).iso / files / umich / utils / strtup15.arc / STARTUP.DOC < prev    next >
Text File  |  1988-03-31  |  20KB  |  487 lines

  1.  .......................................................
  2. /                :                                      \
  3. :   STARTUP.PRG  :  Batch Startup Program Version 1.5   :
  4. :                :      by Murray Levine                :
  5. :                :      CIS # 74435,1015                :
  6. :                :      GENIE ID - MURRAY               :
  7. \................:....................................../
  8.  
  9.         STARTUP.PRG is a Batch Startup program that executes commands
  10. from the file startup.inf upon booting your ST.  STARTUP.PRG must be placed
  11. in the \AUTO\ folder the on boot drive (usually A).  STARTUP.PRG now loads
  12. and runs STARTUP.TOS in order keep the memory less fragmented when loading
  13. memory-resident programs like hard drive drivers and ram disks.  You'll notice
  14. about a 15K difference if using the FREERAM accessory.  It is also possible
  15. to run just the STARTUP.TOS program by changing it's name to STARTUP.PRG and
  16. renaming the original STARTUP.PRG program.  STARTUP first looks for the 
  17. file STARTUP.INF in the same directory and if it can't find it, it tries to
  18. locate it in the main directory (ex. A:STARTUP.INF).  From now on, these
  19. three files can be the only files you need in the AUTO directory because all
  20. other files to be executed can be located in their original drive and folder
  21. and can even have parameters past to them.  You no longer have to make sure
  22. of the order that you copied your files to the AUTO directory because
  23. STARTUP executes programs as they are listed in STARTUP.INF.
  24.  
  25.         The format for programs to be executes is to list the complete program
  26. name followed by any parameters to be passed.  any command or program name
  27. can be followed by a comment.  Any text on a line that follows a ';' will
  28. be treated as a comment.  For example,
  29.  
  30. a:\supboot.prg                  ; Supra Hard Drive driver program
  31. c:\bin\touch.prg a:startup.inf  ; Update time stamp for info file
  32.  
  33. would first load the hard drive driver program supboot,prg from drive A: and
  34. then update the time stamp for the file a:startup.inf.
  35.  
  36.         There are a few unix-like commands that are used in the STARTUP.INF
  37. file as well as some other special commands.  All commands must be in lower
  38. case, however, the file names may be in lower or upper case.  The allowable
  39. commands are as follows:
  40.  
  41. Copy Files:
  42.     cp file1 file2      - copy file1 to file2
  43.     cp file1 ... dir    - copy file1 and other files to the directory dir
  44.  
  45.     The cp command is useful for copying files to a ram disk.  Wildcards
  46.     are also accepted.
  47.  
  48.     cp b:\src\*.c c:\           ; Copy source files to ram disk c:
  49.  
  50.  
  51. Renaming files:
  52.     mv oldfile newfile
  53.  
  54.     The mv command renames the file oldfile to the name newfile.
  55.  
  56.  
  57. Remove files:
  58.     rm file ...
  59.  
  60.     The rm command removes the listed files.  As with cp, wild cards are
  61.     also accepted.  Be careful, though, about doing an   rm *.*
  62.     so you don't wipe out a disk by accident.
  63.  
  64.  
  65. Create directory
  66.     mkdir dir ...
  67.  
  68.     The mkdir command creates the subdirectory dir.
  69.  
  70.  
  71. Remove directories
  72.     rmdir dir ...
  73.  
  74.     The rmdir command removes the specifies subdirectories.  An error will
  75.     occur if the specified subdirectory is not empty or does not exist.
  76.  
  77.  
  78. Display files:
  79.     cat file ...
  80.  
  81.     The cat command displays the listed files on the console.  Useful for
  82.     displaying any title screen information.  Once again, wild cards are
  83.     accepted.  Pressing ctrl-C during the display of a file aborts displaying
  84.     that file and goes  on to the next file if there is one.
  85.  
  86.  
  87. Change directory:
  88.     cd dir
  89.  
  90.     The cd command changes the default directory to either a disk drive or
  91.     a subdirectory.
  92.  
  93.     cd b:       ; changes default drive to b:
  94.     cd b:\auto  ; change to drive b:, subdirectory auto
  95.  
  96.     The cd command is useful if when running programs you don't want to list
  97.     the complete file name (drive and directory) and if the program being
  98.     executed expects to find certain files (data files) in the default 
  99.     directory.
  100.  
  101.  
  102. Display text:
  103.     echo [-in] [-x xpos] [-y ypos] string
  104.  
  105.     The echo command displays the following string (list of words) on the
  106.     screen followed by a carriage return.  If the -n option is used, the
  107.     carriage return is not printed.  If the -i option is used, the string
  108.     is printed in inverse video.  The -x option will position the cursor at
  109.     column xpos and the -y option will position the cursor at line ypos. 
  110.     The echo command is useful for displaying what is happening at 
  111.     different points of the boot process.
  112.  
  113.     As an example, I use the following:
  114.  
  115.     echo -n The time is
  116.     c:\bin\date.prg             ; display the current time
  117.  
  118.     This will display:  The time is Sat Jan 24 1987 12:24pm
  119.  
  120.  
  121. Setting variables
  122.     set var = string    - set variable var to string
  123.     set var = $<        - set variable var to a string entered from keyboard
  124.     set var = $<<       - set variable var to one character from keyboard
  125.     set                 - display all variables
  126.  
  127.     The set command allows the user to set up to 20 variables whose variable
  128.     names can be up to 8 characters in length.  If string is to be more than
  129.     than one word then it should be in quotes, e.g. "This is a string".  If
  130.     the string is $<, then the variable waits for a string to be entered from
  131.     the keyboard.  If the string is $<<, then the variable waits for a single
  132.     key to be hit on the keyboard.  This string can then be tested later using
  133.     the if command.  Using set without any arguments will display all of the
  134.     variables and the string values associated with them.
  135.  
  136.  
  137. Accessing variables
  138.     To get the value of a string, a $ is placed in front of the name, for
  139.     example:
  140.         set test = "This is a test"
  141.         echo $test
  142.     This will display the value of variable test.
  143.  
  144.     Variables representing file names can also have suffixes.  The suffixes
  145.     supported by STARTUP are:
  146.                 :h      - head - returns path name of file
  147.                 :t      - tail - returns file name without path name
  148.                 :r      - root - returns file name without extension
  149.                 :e      - extension - returns file name extension
  150.  
  151.     For example:
  152.         set file=c:\startup\startup.prg
  153.         echo $file:h            => c:\startup
  154.         echo $file:t            => startup.prg
  155.         echo $file:r            => c:\startup\startup
  156.         echo $file:e            => prg
  157.  
  158.  
  159. Conditional statements
  160.     if (expression) then
  161.         commands
  162.     endif
  163.     if (expression) then
  164.         commands
  165.     else
  166.         commands
  167.     endif
  168.  
  169.     The if command is used to test the validity of the specified
  170.     expression.  If the expression is true, the commands following the
  171.     then statement will be executed.  An optional else statement can be
  172.     used if the expression is false.  The if command must end with the
  173.     endif statement.  There can be as many as 9 nested if statements,
  174.     however be sure that there are enough endif statements to match them.
  175.     The expression has two forms.  They are:
  176.  
  177.         (string1 condition string2)
  178.         (option file name)
  179.  
  180.     In the first form, string1 and string2 can be either strings or variables.
  181.     The possible conditions are as follows:
  182.  
  183.         ==      is equal to
  184.         !=      is not equal to
  185.         <       is less than
  186.         >       is greater than
  187.         <=      is less than or equal to
  188.         >=      is greater than or equal to
  189.  
  190.     An example of this form of the  if command would be:
  191.         echo -n Enter your name
  192.         set name = $<
  193.         if ($name == Murray) then
  194.             echo Sysop Murray is on-line
  195.         endif
  196.  
  197.     In the second form of the expression, option has the following values:
  198.  
  199.         -e      - existence - does the file exist?
  200.         -d      - directory - is the file a subdirectory?
  201.         -f      - normal    - is the file not a directory?
  202.         -w      - writeable - is the file writeable (not write protected)?
  203.         -z      - zerosize  -